home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gui / muibuilderv11.lha / muibuilder / mb / asm / frq.asm < prev    next >
Assembly Source File  |  1994-03-15  |  8KB  |  364 lines

  1.     include    ssmac.h
  2.     include    values/mui.gs
  3.     include    libraries/mui_asm.i
  4.     include    libraries/mui_lib.i
  5.  
  6. MR    EQUR    a4
  7.  
  8. DEBUG    equ    1
  9.  
  10.     start
  11.  
  12. CALLINT    macro
  13.     call    intuition,\1
  14.     endm
  15.  
  16.     dv.l    errsp
  17.     dv.l    store
  18.     dv.l    store2
  19.     dbuf    buf2,256
  20.  
  21.     put.l    a7,errsp
  22.  
  23.     bsr    InitGUI
  24.  
  25.     DoMethod    WI_label_0,#MUIM_Notify,#MUIA_Window_CloseRequest,#TRUE,app,#2,#MUIM_Application_ReturnID,#MUIV_Application_ReturnID_Quit
  26.     DoMethod    BT_label_1,#MUIM_Notify,#MUIA_Pressed,#TRUE,app,#2,#MUIM_Application_ReturnID,#MUIV_Application_ReturnID_Quit
  27.     DoMethod    LV_label_0,#MUIM_Notify,#MUIA_Listview_DoubleClick,#MUIV_EveryTime,app,#2,#MUIM_Application_ReturnID,#1
  28.     DoMethod    LV_label_0,#MUIM_Notify,#MUIA_List_Active,#MUIV_EveryTime,app,#3,#MUIM_CallHook,#hook_filesel_str,a5
  29.     DoMethod    LV_label_1,#MUIM_Notify,#MUIA_List_Active,#MUIV_EveryTime,app,#3,#MUIM_CallHook,#hook_volsel_str,a5
  30.     DoMethod    STR_label_0,#MUIM_Notify,#MUIA_String_Acknowledge,#MUIV_EveryTime,app,#3,#MUIM_CallHook,#hook_dir_str,a5
  31.     DoMethod    STR_label_1,#MUIM_Notify,#MUIA_String_Acknowledge,#MUIV_EveryTime,app,#2,#MUIM_Application_ReturnID,#1
  32.     DoMethod    BT_label_2,#MUIM_Notify,#MUIA_Pressed,#TRUE,app,#3,#MUIM_CallHook,#hook_parent_str,a5
  33.     DoMethod    BT_label_0,#MUIM_Notify,#MUIA_Pressed,#TRUE,app,#2,#MUIM_Application_ReturnID,#1
  34.  
  35.     seti    WI_label_0,#MUIA_Window_Open,#TRUE
  36.  
  37. 1$    DoMethod    app,#MUIM_Application_Input,#signal
  38.     tst.l    d0
  39.     bne.s    2$
  40.     move.l    signal(pc),d0
  41.     call    exec,Wait
  42.     bra.s    1$
  43. 2$    moveq    #1,d1
  44.     cmp.l    d1,d0
  45.     beq.s    end
  46.     cmp.l    #MUIV_Application_ReturnID_Quit,d0
  47.     bne.s    1$
  48.  
  49. no_file    err    <You didn''t choose any file>
  50.  
  51.     rts
  52.  
  53. end    geta    store,a1
  54.     geti    STR_label_0,#MUIA_String_Contents,a1
  55.     geta    store2,a1
  56.     geti    STR_label_1,#MUIA_String_Contents,a1
  57.     get.l    store2,a0
  58.     tst.b    (a0)
  59.     beq.s    no_file
  60.  
  61.     get.l    store,a0
  62.     geta    buf2,a1
  63.     tst.b    (a0)
  64.     beq.s    2$
  65. 1$    move.b    (a0)+,(a1)+
  66.     bne.s    1$
  67.     subq.l    #2,a1
  68.     cmp.b    #'/',(a1)
  69.     beq.s    2$
  70.     cmp.b    #':',(a1)+
  71.     beq.s    2$
  72.     move.b    #'/',(a1)+
  73.     clr.b    (a1)
  74. 2$    push    store2(v)
  75.     pea    buf2(v)
  76.     dtl    <You choosed file ''%s%s''.',10,'>,a0
  77.     move.l    a0,d1
  78.     move.l    a7,d2
  79.     call    dos,VPrintf
  80.     addq.l    #8,a7
  81.     rts
  82.  
  83. hook_parent_str    dc.l    0
  84.     dc.l    0
  85.     dc.l    hook_parent
  86.     dc.l    hook_parent
  87.     dc.l    0
  88.  
  89. hook_parent    mpush    a5/a6
  90.     move.l    (a1),a5
  91.     geta    store,a1
  92.     geti    STR_label_0,#MUIA_String_Contents,a1
  93.     get.l    store,a0
  94.     geta    buf2,a1
  95.     moveq    #0,d1
  96. 1$    move.b    (a0),(a1)+
  97.     move.b    (a0)+,d0
  98.     beq.s    2$
  99.     cmp.b    #':',d0
  100.     bne.s    3$
  101.     move.l    a1,d1
  102.     bra.s    1$
  103.  
  104. 3$    cmp.b    #'/',d0
  105.     bne.s    1$
  106.     tst.b    (a0)
  107.     beq.s    2$
  108.     move.l    a1,d1
  109.     subq.l    #1,d1
  110.     bra.s    1$
  111.  
  112. 2$    tst.l    d1
  113.     beq    ret
  114.  
  115.     move.l    d1,a0
  116.     clr.b    (a0)
  117.  
  118.     geta    buf2,a0
  119.     seti    STR_label_0,#MUIA_String_Contents,a0
  120.  
  121.     bra    refrdir
  122.  
  123. hook_dir_str    dc.l    0
  124.     dc.l    0
  125.     dc.l    hook_dir
  126.     dc.l    hook_dir
  127.     dc.l    0
  128.  
  129. hook_dir    mpush    a5/a6
  130.     move.l    (a1),a5
  131.     geta    store,a1
  132.     geti    STR_label_0,#MUIA_String_Contents,a1
  133.     bra    refrdir
  134.  
  135. hook_volsel_str    dc.l    0
  136.     dc.l    0
  137.     dc.l    hook_volsel
  138.     dc.l    hook_volsel
  139.     dc.l    0
  140.  
  141. hook_volsel    mpush    a5/a6
  142.     move.l    (a1),a5
  143.     geta    store,a0
  144.     DoMethod    LV_label_1,#MUIM_List_GetEntry,#MUIV_List_GetEntry_Active,a0
  145.     get.l    store,a0
  146.     seti    STR_label_0,#MUIA_String_Contents,a0
  147.     bra    refrdir
  148.  
  149. hook_filesel_str    dc.l    0
  150.     dc.l    0
  151.     dc.l    hook_filesel
  152.     dc.l    hook_filesel
  153.     dc.l    0
  154.  
  155. hook_filesel    mpush    a5/a6
  156.     move.l    (a1),a5
  157.     geta    store,a0
  158.     DoMethod    LV_label_0,#MUIM_List_GetEntry,#MUIV_List_GetEntry_Active,a0
  159.     get.l    store,a0
  160.     move.l    4(a0),d0
  161.     addq.l    #8,a0
  162.     bpl.s    fs_newdir
  163.     seti    STR_label_1,#MUIA_String_Contents,a0
  164. ret    mpop    a5/a6
  165.     rts
  166.  
  167. fs_newdir    push    a0
  168.     geta    store,a1
  169.     geti    STR_label_0,#MUIA_String_Contents,a1
  170.     geta    buf2,a1
  171.     get.l    store,a0
  172.     moveq    #':',d0
  173. 1$    tst.b    (a0)
  174.     beq.s    2$
  175.     move.b    (a0),d0
  176.     move.b    (a0)+,(a1)+
  177.     bra.s    1$
  178. 2$    cmp.b    #':',d0
  179.     beq.s    3$
  180.     cmp.b    #'/',d0
  181.     beq.s    3$
  182.     move.b    #'/',(a1)+
  183. 3$    pop    a0
  184. 4$    move.b    (a0)+,(a1)+
  185.     bne.s    4$
  186.     subq.l    #2,a1
  187.     cmp.b    #'/',(a1)
  188.     bne.s    5$
  189.     clr.b    (a1)
  190. 5$    geta    buf2,a0
  191.     seti    STR_label_0,#MUIA_String_Contents,a0
  192.  
  193. refrdir    get.l    store,a0
  194.     seti    LV_label_0,#MUIA_Dirlist_Directory,a0
  195.     mpop    a5/a6
  196.     rts
  197.  
  198. cleanup    move.l    app(pc),d0
  199.     beq.s    1$
  200.     move.l    d0,a0
  201.     call    muimaster,MUI_DisposeObject
  202. 1$    rts
  203.  
  204. _DoMethod    push    a2
  205.     move.l    8(a7),a2
  206.     move.l    a2,d0
  207.     beq.s    1$
  208.     lea    12(a7),a1
  209.     move.l    -4(a2),a0
  210.     move.l    8(a0),a6
  211.     jsr    (a6)
  212.     pop    a2
  213.     rts
  214.  
  215. 1$    moveq    #0,d0
  216.     pop    a2
  217.     rts
  218.  
  219. signal    ds.l    1
  220.  
  221. InitGUI    mpush    a2/d7
  222.     move.l    a7,d7
  223.     lea    object_tags(pc),a2
  224. 1$    tst.l    (a2)
  225.     beq.s    2$
  226.  
  227.     move.l    #$8FFFFFFF,d0
  228.     lea    8(a2),a0
  229.     moveq    #0,d1
  230. 3$    tst.l    (a0)
  231.     beq.s    4$
  232.     cmp.l    (a0),d0
  233.     bne.s    5$
  234.     addq.l    #4,d1
  235. 5$    addq.l    #8,a0
  236.     bra.s    3$
  237.  
  238. 4$    tst.l    d1
  239.     beq.s    10$
  240.     lea    8(a2),a0
  241.     lea    (a7,d1.l),a1
  242.     push    a1
  243. 7$    tst.l    (a0)
  244.     beq.s    8$
  245.     cmp.l    (a0),d0
  246.     bne.s    9$
  247.     move.l    4(a0),(a0)+
  248.     move.l    -(a1),(a0)+
  249.     bra.s    7$
  250. 9$    addq.l    #8,a0
  251.     bra.s    7$
  252.  
  253. 8$    pop    a7
  254.  
  255. 10$    push    a0
  256.     move.l    (a2),a0
  257.     move.l    (a0),a0
  258.     lea    8(a2),a1
  259.     call    muimaster,MUI_NewObjectA
  260.     move.l    4(a2),a0
  261.     move.l    a0,d1
  262.     beq.s    11$
  263.     move.l    d0,(a0)
  264. 11$    pop    a2
  265.     tst.l    d0
  266.     beq.s    12$
  267.     push    d0
  268.     addq.l    #4,a2
  269.     bra.s    1$
  270.  
  271. 2$    move.l    d7,a7
  272. 13$    mpop    a2/d7
  273.     rts
  274.  
  275. 12$    moveq    #0,d0
  276.     cmp.l    d7,a7
  277.     beq.s    13$
  278.     pop    a0
  279.     call    muimaster,MUI_DisposeObject
  280.     bra.s    12$
  281.  
  282. object_tags    dc.l    MUIC_Dirlist,0,MUIA_Frame,MUIV_Frame_InputList,MUIA_Dirlist_Directory,str9,MUIA_Dirlist_DrawersOnly,0,MUIA_Dirlist_FilesOnly,0,MUIA_Dirlist_FilterDrawers,0
  283.     dc.l    MUIA_Dirlist_MultiSelDirs,0,MUIA_Dirlist_RejectIcons,0,MUIA_Dirlist_SortDirs,MUIV_Dirlist_SortDirs_First,MUIA_Dirlist_SortHighLow,0,MUIA_Dirlist_SortType,0
  284.     dc.l    0
  285.  
  286.     dc.l    MUIC_Listview,LV_label_0,MUIA_Weight,300,$8FFFFFFF,MUIA_Listview_List,0
  287.  
  288.     dc.l    MUIC_Volumelist,0,MUIA_Frame,MUIV_Frame_InputList,0
  289.  
  290.     dc.l    MUIC_Listview,LV_label_1,$8FFFFFFF,MUIA_Listview_List,0
  291.  
  292.     dc.l    MUIC_Group,0,MUIA_Group_Horiz,1,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,0
  293.  
  294.     dc.l    MUIC_Text,0,MUIA_Text_PreParse,PreParse2,MUIA_Text_Contents,str10,MUIA_Weight,0,MUIA_InnerLeft,0
  295.     dc.l    MUIA_InnerRight,0,MUIA_Frame,MUIV_Frame_String,MUIA_FramePhantomHoriz,1,0
  296.  
  297.     dc.l    MUIC_String,STR_label_0,MUIA_Frame,MUIV_Frame_String,MUIA_String_Format,0,0
  298.  
  299.     dc.l    MUIC_Group,0,MUIA_Group_Columns,2,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,0
  300.  
  301.     dc.l    MUIC_Text,0,MUIA_Text_PreParse,PreParse2,MUIA_Text_Contents,str11,MUIA_Weight,0,MUIA_InnerLeft,0
  302.     dc.l    MUIA_InnerRight,0,MUIA_Frame,MUIV_Frame_String,MUIA_FramePhantomHoriz,1,0
  303.  
  304.     dc.l    MUIC_String,STR_label_1,MUIA_Frame,MUIV_Frame_String,MUIA_String_Format,0,0
  305.  
  306.     dc.l    MUIC_Group,0,MUIA_Group_Columns,2,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,0
  307.  
  308.     dc.l    MUIC_Text,BT_label_0,MUIA_Frame,MUIV_Frame_Button,MUIA_Text_Contents,str12,MUIA_Text_PreParse,PreParse,MUIA_Text_SetMax,FALSE
  309.     dc.l    MUIA_Text_HiChar,'o',MUIA_ControlChar,'o',MUIA_InputMode,MUIV_InputModeRelVerify,MUIA_Background,MUII_ButtonBack,0
  310.  
  311.     dc.l    MUIC_Rectangle,0,0
  312.  
  313.     dc.l    MUIC_Text,BT_label_2,MUIA_Frame,MUIV_Frame_Button,MUIA_Text_Contents,str13,MUIA_Text_PreParse,PreParse,MUIA_Text_SetMax,FALSE
  314.     dc.l    MUIA_Text_HiChar,'p',MUIA_ControlChar,'p',MUIA_InputMode,MUIV_InputModeRelVerify,MUIA_Background,MUII_ButtonBack,0
  315.  
  316.     dc.l    MUIC_Rectangle,0,0
  317.  
  318.     dc.l    MUIC_Text,BT_label_1,MUIA_Frame,MUIV_Frame_Button,MUIA_Text_Contents,str14,MUIA_Text_PreParse,PreParse,MUIA_Text_SetMax,FALSE
  319.     dc.l    MUIA_Text_HiChar,'c',MUIA_ControlChar,'c',MUIA_InputMode,MUIV_InputModeRelVerify,MUIA_Background,MUII_ButtonBack,0
  320.  
  321.     dc.l    MUIC_Group,0,MUIA_Group_Horiz,1,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF
  322.     dc.l    MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF
  323.     dc.l    MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,0
  324.  
  325.     dc.l    MUIC_Group,0,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child,$8FFFFFFF,MUIA_Group_Child
  326.     dc.l    0
  327.  
  328.     dc.l    MUIC_Window,WI_label_0,MUIA_Window_Title,str7,MUIA_HelpNode,str8,$8FFFFFFF,MUIA_Window_RootObject,0
  329.  
  330.     dc.l    MUIC_Application,app,MUIA_Application_Author,str1,MUIA_Application_Base,str2,MUIA_Application_Title,str3,MUIA_Application_Version,str4
  331.     dc.l    MUIA_Application_Copyright,str5,MUIA_Application_Description,str6,$8FFFFFFF,MUIA_Application_Window,0
  332.  
  333.     dc.l    0
  334.  
  335. app    dc.l    0
  336. WI_label_0    dc.l    0
  337. LV_label_0    dc.l    0
  338. LV_label_1    dc.l    0
  339. STR_label_0    dc.l    0
  340. STR_label_1    dc.l    0
  341. BT_label_0    dc.l    0
  342. BT_label_2    dc.l    0
  343. BT_label_1    dc.l    0
  344. str1    dc.b    'Misoftware Computing',0
  345. str2    dc.b    'Base',0
  346. str3    dc.b    'FileReq',0
  347. str4    dc.b    '1.0',0
  348. str5    dc.b    'Copyright 1994 Misoftware Computing',0
  349. str6    dc.b    'Chooses file',0
  350. str7    dc.b    'Choose file',0
  351. str8    dc.b    'WI_label_0',0
  352. str9    dc.b    'progdir:',0
  353. str10    dc.b    'Drawer',0
  354. str11    dc.b    'File',0
  355. str12    dc.b    ' Okay ',0
  356. str13    dc.b    'Parent',0
  357. str14    dc.b    'Cancel',0
  358. erro1    dc.b    "Failed to create application. MUI Error: %d",10,0
  359.  
  360.     tags
  361.     library    muimaster,2
  362.     exitrout    cleanup
  363.     finish
  364.